package com.gaofans.nrpc.client.route;

/**
 * @author GaoFans
 */
public class ServiceEvent<T> {

    private final EventType type;

    private final T data;

    public ServiceEvent(EventType type, T data) {
        this.type = type;
        this.data = data;
    }

    public EventType getType() {
        return type;
    }

    public T getData() {
        return data;
    }

    public static enum EventType{
        /**
         * 添加事件
         */
        ADD,
        /**
         * 移除事件
         */
        REMOVE,
        /**
         * 关闭
         */
        CLOSE,
        /**
         * 更新事件
         */
        UPDATE
    }
}
